from flask import Flask, json

from utils.log_handler import LogHandler



def create_app():
    # init app
    app = Flask(__name__)
    # # 读取json配置
    # app.config.from_file("settings.json", load=json.load)
    # # 初始化Cache
    # cache = CacheHelper(app, config={'CACHE_TYPE': 'simple'})
    # 添加日志配置
    for log_handler in LogHandler.get_log_handlers():
        app.logger.addHandler(log_handler)
    return app

